package ncku.account.gui;


 /****************************************************************/ 
 /*                      multiChart	                            */ 
 /*                                                              */ 
 /****************************************************************/ 
 import java.awt.*; 
 import javax.swing.*; 
 import javax.swing.event.*; 
 /** 
  * Summary description for multiChart 
  * 
  */ 
 public class multiChart extends JInternalFrame { 
 	// Variables declaration 
 	private JTabbedPane multiChart; 
 	private JPanel contentPane; 
 	//----- 
 	private JPanel jPanel1; 
 	//----- 
 	private JPanel jPanel2; 
 	//----- 
 	private JPanel jPanel3; 
 	//----- 
 	// End of variables declaration 
  
  
 	public multiChart() 
 	{ 
 		super(); 
 		initializeComponent(); 
 		// 
 		// TODO: Add any constructor code after initializeComponent call 
 		// 
  
 		this.setVisible(true); 
 	} 
  
 	/** 
 	 * This method is called from within the constructor to initialize the form. 
 	 * WARNING: Do NOT modify this code. The content of this method is always regenerated 
 	 * by the Windows Form Designer. Otherwise, retrieving design might not work properly. 
 	 * Tip: If you must revise this method, please backup this GUI file for JFrameBuilder 
 	 * to retrieve your design properly in future, before revising this method. 
 	 */ 
 	private void initializeComponent() 
 	{ 
 		multiChart = new JTabbedPane(); 
 		contentPane = (JPanel)this.getContentPane(); 
 		//----- 
 		jPanel1 = new JPanel(); 
 		//----- 
 		jPanel2 = new JPanel(); 
 		//----- 
 		jPanel3 = new JPanel(); 
 		//----- 
  
 		// 
 		// multiChart 
 		// 
 		multiChart.addTab("   Line Chart   ", jPanel1); 
 		multiChart.addTab("   Pie Chart   ", jPanel2); 
 		multiChart.addTab("   Bar Chart   ", jPanel3); 
 		multiChart.addChangeListener(new ChangeListener() { 
 			public void stateChanged(ChangeEvent e) 
 			{ 
 				multiChart_stateChanged(e); 
 			} 
  
 		}); 
 		// 
 		// contentPane 
 		// 
 		contentPane.setLayout(null); 
 		addComponent(contentPane, multiChart, 0,4,767,626); 
 		// 
 		// jPanel1 
 		// 
 		jPanel1.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5)); 
 		// 
 		// jPanel2 
 		// 
 		jPanel2.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5)); 
 		// 
 		// jPanel3 
 		// 
 		jPanel3.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5)); 
 		// 
 		// multiChart 
 		// 
 		this.setTitle("multiChart - extends JInternalFrame"); 
 		this.setLocation(new Point(0, 0)); 
 		this.setSize(new Dimension(793, 671)); 
 		this.setResizable(true); 
 	} 
  
 	/** Add Component Without a Layout Manager (Absolute Positioning) */ 
 	private void addComponent(Container container,Component c,int x,int y,int width,int height) 
 	{ 
 		c.setBounds(x,y,width,height); 
 		container.add(c); 
 	} 
  
 	// 
 	// TODO: Add any appropriate code in the following Event Handling Methods 
 	// 
 	private void multiChart_stateChanged(ChangeEvent e) 
 	{ 
 		System.out.println("\nmultiChart_stateChanged(ChangeEvent e) called."); 
 		// TODO: Add any handling code here 
  
 	} 
  
 	// 
 	// TODO: Add any method code to meet your needs in the following area 
 	// 
  
  
  
  
  
  
 //============================= Testing ================================// 
 //=                                                                    =// 
 //= The following main method is just for testing this class you built.=// 
 //= After testing,you may simply delete it.                            =// 
 //======================================================================// 
 	public static void main(String[] args) 
 	{ 
//new
  //JFrame frame = new JFrame ("toolbar");
///new

 		final JFrame frame 		= new JFrame("toolbar"); 
 		final JDesktopPane desktop = new JDesktopPane(); 
 //MERGE
 		JMenu accountMenu = new JMenu ("Account");
        JMenuItem new_accountItem = new JMenuItem ("New Account");
 		accountMenu.add(new_accountItem); 
        JMenuItem importItem = new JMenuItem ("Import");
        accountMenu.add (importItem);
        JMenuItem exportItem = new JMenuItem ("Export");
        accountMenu.add (exportItem);
        JMenu transactionMenu = new JMenu ("Transaction");
        JMenuItem new_transactionItem = new JMenuItem ("New Transaction");
        transactionMenu.add (new_transactionItem); 
       JMenuItem show_transactionItem = new JMenuItem ("Show Transaction");
        transactionMenu.add (show_transactionItem);
        JMenu chartMenu = new JMenu ("Chart");
        JMenuItem line_chartItem = new JMenuItem ("Line Chart");
        chartMenu.add (line_chartItem);
        JMenuItem pie_chartItem = new JMenuItem ("Pie Chart");
        chartMenu.add (pie_chartItem);
        JMenuItem bar_chartItem = new JMenuItem ("Bar Chart");
        chartMenu.add (bar_chartItem);
        JMenu exitMenu = new JMenu ("Exit");
        JMenuItem close_windowItem = new JMenuItem ("Close Window");
        exitMenu.add (close_windowItem);
        JMenuItem exit_programItem = new JMenuItem ("Exit Program");
        exitMenu.add (exit_programItem);
        String[] categorySelItems = {"Item 1", "Item 2", "Item 3"};



//constructions
 		JMenuBar menuBar 	= new JMenuBar(); 
		frame.setContentPane(desktop); 
 		frame.setJMenuBar(menuBar); 
        menuBar.add (accountMenu);
        menuBar.add (transactionMenu);
        menuBar.add (chartMenu);
        menuBar.add (exitMenu);
       
//open chart
 		//menuBar.add(menu); 
	//	chartMenu.add(menuItem); 
 		line_chartItem.addActionListener(new java.awt.event.ActionListener() { 
 							public void actionPerformed(java.awt.event.ActionEvent e) 
 							{ 
 								//-- Create a multiChart -- 
 								multiChart JIF = new multiChart(); 
 								desktop.add(JIF); 
 								try 
 								{ 
 									JIF.setSelected(true); 
 								} 
 								catch (java.beans.PropertyVetoException ee) {} 
 								//--------------------- 
 							}}); 
pie_chartItem.addActionListener(new java.awt.event.ActionListener() { 
							public void actionPerformed(java.awt.event.ActionEvent e) 
							{ 
								//-- Create a multiChart -- 
								multiChart JIF = new multiChart(); 
								desktop.add(JIF); 
								try 
								{ 
									JIF.setSelected(true); 
								} 
								catch (java.beans.PropertyVetoException ee) {} 
								//--------------------- 
							}}); 

	 		bar_chartItem.addActionListener(new java.awt.event.ActionListener() { 
 							public void actionPerformed(java.awt.event.ActionEvent e) 
 							{ 
 								//-- Create a multiChart -- 
 								multiChart JIF = new multiChart(); 
 								desktop.add(JIF); 
 								try 
 								{ 
 									JIF.setSelected(true); 
 								} 
 								catch (java.beans.PropertyVetoException ee) {} 
 								//--------------------- 
 							}}); 

 		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
 		
		frame.setSize(700,500); 
 		frame.setLocation(50,50); 
 		frame.setVisible(true); 
 	} 
 //= End of Testing = 
  
  
 } 
  
 